<template>
<!-- 左侧菜单列表 -->
  <aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
    <div class="aui-sidebar__inner">
      <el-menu
        :default-active="$store.state.sidebarMenuActiveName"
        :collapse="$store.state.sidebarFold"
        :unique-opened="true"
        :collapseTransition="false"
        class="aui-sidebar__menu">
        <sub-menu v-for="menu in menulist" :key="menu.id" :menu="menu" />
      </el-menu>
    </div>
  </aside>
</template>

<script>
import SubMenu from './main-sidebar-sub-menu'
import {userinfoList} from "../router/userinfo"
import {fnAddDynamicMenuRoutes} from "../router/index"
export default {
  // userinfoList,
  inject: ['reload'],
  data () {
    return {
      menulist:[]
    }
  },
  components: {
    SubMenu
  },
  mounted(){
    // if(JSON.parse(localStorage.getItem('userinfo'))!=null){
      userinfoList()
      this.menulist = window.SITE_CONFIG['menuList']
      fnAddDynamicMenuRoutes(window.SITE_CONFIG['menuList'])
    // }
  },
  methods:{
  }
}
</script>
